"Grid maxmin"
Bootstrap 4.1.1 Snippet by SANTANU CHOWDHURY

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container-fluid">
<div class="image-card">
<div>
<div class="image-card__image-area">
<img src="https://placehold.co/600x400"></img>
</div>
<div class="image-card__details">
<div>image-name.jpg</div>
</div>
</div>
<div>
<div class="image-card__image-area">
<img src="https://placehold.co/600x400"></img>
</div>
<div class="image-card__details">
<div>image-name.jpg</div>
</div>
</div>
<div>
<div class="image-card__image-area">
<img src="https://placehold.co/600x400"></img>
</div>
<div class="image-card__details">
<div>image-name.jpg</div>
</div>
</div>
<div>
<div class="image-card__image-area">
<img src="https://placehold.co/600x400"></img>
</div>
<div class="image-card__details">
<div>image-name.jpg</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.image-card{
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 16px;
padding: 0px 10px;
/* display: none; */
}
.image-card > div{
flex-basis: 200px;
flex-grow: 1;
min-height: 200px;
border: 1px solid #ddd;
text-align: center;
border-radius: 10px;
}
.image-card__image-area img{
width: 100%;
height: 200px;
object-fit: cover;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.image-card__details{
padding: 10px 5px 12px;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: